<template>
  <div class="container" v-if="route.name === 'home'">
    <span class="title">点击跳转到对应页面</span>
    <div class="router-list">
      <span class="router-item" @click="router.push({ name: item.path })" v-for="item in routerListData">{{ item.name
        }}</span>
    </div>
  </div>
  <router-view />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter , useRoute} from 'vue-router'

const route = useRoute()
const router = useRouter()
const routerListData = ref([
  {
    name: '视频列表页面',
    path: 'video-list'
  },
  {
    name: '建设历程页面',
    path: 'product-presentation'
  }
])

</script>

<style lang="scss" scoped>
.container{
  width: 100%;
  height: 100%;
  padding: 20% 20% 12px 20%;
  display: flex;
  flex-direction: column;
  /* justify-content: center; */
  /* align-items: center; */
}

.title{
  font-size: 20px;
  margin-bottom: 20px;
}

.router-list{
  width: 100%;
  /* border: 1px solid red; */
  display: flex;
  align-items: center;

  .router-item{
    border-radius: 4px;
    background: #eee;
    padding: 8px 16px;
    margin-right: 10px;
    cursor: pointer;
  }
}
</style>